<HTML><HEAD><TITLE>set(?SetVariable, ++Glb, ++Poss, +Functions)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(cardinal)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>set(?SetVariable, ++Glb, ++Poss, +Functions)</H1>
Set variable declaration with optional functions
<DL>
<DT><EM>SetVariable</EM></DT>
<DD>A variable.
</DD>
<DT><EM>Glb</EM></DT>
<DD>A ground set.
</DD>
<DT><EM>Poss</EM></DT>
<DD>A ground set.
</DD>
<DT><EM>Functions</EM></DT>
<DD>A list.
</DD>
</DL>
<H2>Description</H2>
Declare or constrain a set domain variable to have Glb as assured
		elements and Poss as the possible additional elements.<P>
		Functions is a list of functions over SetVariable in the form
		FunctionName:FunctionValue, where FunctionName can be 'cardinality',
		'minimum', 'maximum' or 'union':
<PRE>
  cardinality: FunctionValue can be an integer, an FD variable or an integer domain (list or range)
  union: (SetVariable must be a set of sets.) FunctionValue can be a set, a set variable
	or a set domain in the form GlbUnion+PossUnion, representing the glb and poss of
	the union of SetVariable
  minimum and maximum: (SetVariable must be a nonempty set of integers.)
	FunctionValue can be an integer, an FD variable or an integer domain
</PRE>
		Cardinal inferences over SetVariable and its union, minimum and maximum
		functions will be performed only if these functions are explicitly
		declared, whereas the cardinality function and respective inferences
		will always be present even if this (cardinality) function is not
		explicitly declared. Note that a simple function declaration such as
		minimum:_ is sufficient to make it 'active'.
<H3>Fail Conditions</H3>
Fails if SetVariable can not be constrained accordingly.
<H3>Resatisfiable</H3>
No.
<H2>Examples</H2>
<PRE>
?- set(S,[],[a,b],[]).
?- set(S,[],[a,b],[cardinality:1]).
?- set(S,[],[a,b],[cardinality:C]).
?- set(S,[],[a,b],[cardinality:[0,2]]).
?- set(S,[c],[a,b,d,e,f,g,h,i,j,k],[cardinality:[2,4..7]]).
?- set(S,[],[1,3,4,5,7],[minimum:Min,maximum:Max]), fd:(Max #&gt; Min+2).
?- set(S, [], [[1,2,5],[2,4],[3,5],[1,3,4]],
	[cardinality:2, union:[1,2,3,4,5]]).   %set-covering
?- set(S, [], [[1,2,5],[2,4],[3,5],[1,3,4]], [union:[1]+[2,4,5]]).
</PRE>
<H2>See Also</H2>
<A HREF="../../lib_public/cardinal/sets-4.html">sets / 4</A>, <A HREF="../../lib_public/cardinal/BNN-2.html">`:: / 2</A>, <A HREF="../../lib_public/cardinal/cardinality-2.html">cardinality / 2</A>, <A HREF="../../lib_public/cardinal/union_var-2.html">union_var / 2</A>, <A HREF="../../lib_public/cardinal/minimum-2.html">minimum / 2</A>, <A HREF="../../lib_public/cardinal/maximum-2.html">maximum / 2</A>, <A HREF="../../lib_public/cardinal/set_labeling-1.html">set_labeling / 1</A>
</BODY></HTML>
